#ifndef __OUR_GL_H__
#define __OUR_GL_H__
 
#include "tgaimage.h"
#include "geometry.h"
 
extern Matrix ModelView; //坐标轴随相机移动
extern Matrix Viewport; //映射至屏幕
extern Matrix Projection; //投影矩阵
 
void viewport(int x, int y, int w, int h);
void projection(float coeff = 0.f); // coeff = -1/c
void lookat(Vec3f eye, Vec3f center, Vec3f up);
 
struct IShader {
    virtual ~IShader();
    virtual Vec4f vertex(int iface, int nthvert) = 0;       //顶点着色器
    virtual bool fragment(Vec3f bar, TGAColor& color) = 0;  //片元着色器
};
 
void triangle(Vec4f* pts, IShader& shader, TGAImage& image, TGAImage& zbuffer);
 
#endif //__OUR_GL_H__
 